<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/common.jsp"%>
<%@include file="/common/skins/skin0/component.jsp" %>
<h:css href="/css/style1/style-custom.css"/>
<%--
- Author(s): pengweiling
- Date: 2012-07-25 17:14:19
- Description:
--%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>
      物品遗留登记
    </title>
  </head>
  <body>
    <e:datasource name="wemateriallost" type="entity" path="com.hms.OrderMgr.order.WeMateriallost" />
    <h:form name="data_form" action="com.hms.OrderMgr.WeMateriallostMaintain.flow" method="post" onsubmit="return checkForm(this);">
      <h:hidden property="lost/ilostid" />
      <l:equal property="_eosLastAccessAction" targetValue="update">
        <input type="hidden" name="_eosFlowAction" value="updateSubmit" >
      </l:equal>
      <l:equal property="_eosLastAccessAction" targetValue="insert">
        <input type="hidden" name="_eosFlowAction" value="insertSubmit" >
      </l:equal>
      <input type="hidden" value="NORMAL" name="actionName">
      <h:hiddendata property="criteria" />
      <h:hidden property="page/begin"/>
      <h:hidden property="page/length"/>
      <h:hidden property="page/isCount"/>
      <dataform id= "97ec9ec2-9114-4a05-bb10-a9cf2bfe6d12">
          <table align="center" border="0" width="100%" class="form_table">
            <h:hidden property="lost/iroomid"/>
            <tr>
              <td class="form_label">
                客单
              </td>
              <td colspan="1">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <w:lookup property="lost/igresid"  
                            style="width:256px;" 
                            dialogTitle="选择客单和房间"
                            displayProperty="lost/cgresno"
                            lookupUrl="com.hms.commonPick.WeOrdersVSelect.flow"
                            onReturnFunc="setOthers"
                            height="400"
                            allowInput="false"
                            validateAttr="allowNull=false"/>
                </l:equal>
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="lost/cgresno" style="width:256px;" readonly="true"/>
                </l:notEqual>   

              </td>
            </tr>
            <tr>
              <td class="form_label">
                房号
              </td>
              <td colspan="1">
                <h:text property="lost/croomno" readonly="true" style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                客人姓名
              </td>
              <td colspan="1">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="lost/cguestname" validateAttr="allowNull=false"  style="width:256px;"/>
                </l:equal>
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="lost/cguestname" validateAttr="allowNull=false" readonly="true"  style="width:256px;"/>
                </l:notEqual>               

              </td>
            </tr>
            <tr>
              <td class="form_label">
                数量
              </td>
              <td colspan="1">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="lost/nqty" validateAttr="type=naturalNumber;allowNull=true"  style="width:256px;"/>
                </l:equal>
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:textarea property="lost/nqty"  style="width:100%" readonly="true"/>
                </l:notEqual> 
              </td>
            </tr>
            <tr>
              <td class="form_label">
                遗留物品
              </td>
              <td colspan="1">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <h:textarea property="lost/cdetails"  style="width:100%" validateAttr="allowNull=false"/>
                </l:equal>
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:textarea property="lost/cdetails"  style="width:100%" readonly="true"/>
                </l:notEqual>                    
              </td>
            </tr>
            <tr>
              <td class="form_label">
                备注
              </td>
              <td colspan="1">
                <h:textarea property="lost/cremarks" style="width:100%"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                登记时间
              </td>
              <td colspan="1">
                <w:date property="lost/dcreated"  readOnly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                领取时间
              </td>
              <td colspan="1">
                <w:date property="lost/dtaked" readOnly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                状态
              </td>
              <td colspan="1">
                <h:select disabled="true" property="lost/cstate"  style="width:256px;color:blue">
                  <option value="N">未取</option>
                  <option value="F">已取</option>
                  <option value="C">取消</option>  
                </h:select>                
              </td>
            </tr>
            <tr>
              <td class="form_label">
                登记人
              </td>
              <td colspan="1">
                <h:text property="lost/createdname"  readonly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                领取操作员
              </td>
              <td colspan="1">
                <h:text property="lost/takedname" readonly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr class="form_bottom">
              <td colspan="2">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                   <input type="submit" value="保存" class="button">
                </l:equal>
                
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <l:equal property="lost/cstate" targetValue="N">
                     <input type="button" value="读取" class="button" onclick="handleLost('GET')">
                     <input type="button" value="取消" class="button"  onclick="handleLost('CANCEL')">
                  </l:equal>
                </l:notEqual>
                
                <input type="button" value="返回" onclick="javascript:history.go(-1);" class="button">
              </td>
            </tr>
          </table>
      </dataform>
    </h:form>
    
    <script>
      function setOthers(args){
         if (args){
            $name("lost/croomno").value = args[3];
            $name("lost/cguestname").value = args[4];
            $name("lost/iroomid").value = args[2];            
         }else{
            $name("lost/croomno").value = "";
            $name("lost/cguestname").value = "";
            $name("lost/iroomid").value = "";            
         }
         return true;
      }
      
      function handleLost(opt){
        $name("actionName").value = opt;
        $name("data_form").submit()
      }
    </script>
  </body>
</html>
